Skip to content

fix(packaging): ship mkconcore's runtime files in the wheel and add a package CI job - #699

Open
yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:ci/package-build
Open

yadavchiragg wants to merge 1 commit into
ControlCore-Project:devfrom
yadavchiragg:ci/package-build

Conversation

@yadavchiragg

Copy link
Copy Markdown

Problem

pip install . (non-editable) gives a package where concore build cannot work:

ModuleNotFoundError: No module named 'copy_with_port_portname'

The wheel only contains mkconcore.py, concore.py, concoredocker.py and concore_base.py. It is missing copy_with_port_portname.py (imported by mkconcore.py) and every runtime file mkconcore.py copies into a study from next to itself: concore.hpp/concore_base.hpp, Dockerfile.*, the .m/.v/.java/.jl helpers, mkcompile, tools/extract_graphml.py. Editable installs (pip install -e .) are unaffected, which is why it went unnoticed.

Change

  • pyproject.toml: add copy_with_port_portname to py-modules
  • setup.py: a build_py step that installs the runtime files next to mkconcore.py (where _resolve_concore_path() looks for them)
  • MANIFEST.in: include the same files in the sdist
  • ci.yml: new package job (ubuntu-24.04): build sdist + wheel, twine check, install the wheel in a clean venv, check that every file mkconcore.py references (and that exists in the repo) is present in the installed package, then build a Python project (posix + docker) and testsou/testSM1 (C++) with the installed concore command
  • the .m list is explicit on purpose, so the test fixture concore_write_bad.m is not shipped

Testing

  • built the wheel and the sdist, installed each into a clean directory, ran concore build from there: output matches a build from the repo (apart from study name/timestamp)
  • the new CI check passes on the fixed wheel and fails on the wheel from dev, listing the 20+ missing files
  • full test suite: same results as dev; ruff clean

Not included / questions

  • Publishing to PyPI on tag is left out; happy to add a release workflow if you want that (the concore name may need checking on PyPI)

…el, add a package CI job

A regular pip install of the built wheel contained mkconcore.py but not copy_with_port_portname.py or any of the runtime files mkconcore copies into a study (concore.hpp, Dockerfile.*, .m/.v/.java/.jl helpers, mkcompile), so 'concore build' failed with ModuleNotFoundError. Add the missing module, install the runtime files next to mkconcore.py via a build_py step, include them in the sdist via MANIFEST.in, and add a CI job that builds the sdist and wheel, checks them with twine, installs the wheel in a clean venv, verifies every file mkconcore.py references is present, and builds studies with the installed command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant